<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="d" uri="/WEB-INF/resource.tld" %>

<fmt:setBundle basename="ApplicationMessage" />
<fmt:setLocale value="zh_CN" />

<!DOCTYPE html>
<html lang="zh-CN">
<head>

<%@ include file="/WEB-INF/include/meta.jsp"%>
<%@ include file="/WEB-INF/include/css.jsp"%>

<title></title>

</head>

<body>

  <%@ include file="/WEB-INF/include/header.jsp"%>

  <%@ include file="/WEB-INF/include/menu.jsp"%>

  <div class="container main-content">

    <div class="panel panel-default x-panel x-panel-layout">

      <div class="panel-heading">
        <ol class="breadcrumb">
          <li><a href="${ctx.host}/user">用户管理</a></li>
          <li class="active">学员用户</li>
          <li class="no-before pull-right" style="min-width: 65px;"><a onclick="window.history.back();"><i class="glyphicon glyphicon-arrow-left"></i>&nbsp;&nbsp;返回</a></li>
        </ol>
      </div>

      <div class="panel-body">

        <div class="col-xs-2 x-panel-layout-left no-horizontal-padding">
          <%@ include file="/WEB-INF/include/submenu.jsp"%>
        </div>

        <div class="col-xs-10 x-panel-layout-right">
          <div class="x-breadcrumb-wrapper">
            <div class="x-breadcrumb clearfix">
              <h2>
                <i class="glyphicon glyphicon-fire" title="用户详情"></i>&nbsp;&nbsp;<span>学员用户&nbsp;-&nbsp;学员详情</span>
              </h2>
            </div>
          </div>

          <div class="x-breadcrumb-wrapper">

            <ul class="nav nav-pills x-breadcrumb-nav ajax-tab" data-content="#tab-content" data-operation="#tab-operation">
              <li class="pull-left active"><a id="profile" href="${ctx.host}/${type}-students/${student.id}" data-toggle="tab" data-target="#student-profile">基本信息</a></li>
              <li class="pull-left"><a id="body" href="${ctx.host}/${type}-students/${student.id}/body" data-toggle="tab" data-target="#student-body">身体信息</a></li> 
              <li class="pull-left"><a id="course" href="${ctx.host}/${type}-students/${student.id}/course" data-toggle="tab" data-target="#student-course">课程信息</a></li> 
              <li class="pull-left"><a id="record" href="${ctx.host}/${type}-students/${student.id}/input-info" data-toggle="tab" data-target="#student-record">档案信息</a></li> 
            </ul>

            <!-- tab operations -->
            <div id="tab-operation" class="tab-operation pull-right">
              <div id="profile-operation" class="tab-operations hide">
                <a href="${ctx.host }/black-list/${student.id}/mobile" data-target="#blackList-edit" data-toggle="modal" title="编辑">编辑短信黑名单</a>
                <a href="${ctx.host }/${type}-students/${student.id}/name" data-target="#profile-edit" data-toggle="modal" title="编辑">编辑姓名</a>
              </div>
            </div>
          </div>

          <!-- Tab panes -->
          <div id="tab-content" class="tab-content ajax-tab-content" style="margin-top: 20px;">
            <div id="student-profile" class="tab-pane fade active in" style="min-height: 100px; margin-top: 20px;">

              <div class="form-horizontal">

                <div class="form-group">
                  <label class="control-label col-xs-2">姓名：</label>
                  <div class="col-xs-4 pull-left">
                    <p class="form-control-static">${student.name}</p>
                  </div>
                  <label class="control-label col-xs-2">学员编号：</label>
                  <div class="col-xs-4 pull-left">
                    <p class="form-control-static">${student.code}</p>
                  </div>
                </div>
                  
                <div class="form-group">
                  <label class="control-label col-xs-2">手机：</label>
                  <div class="col-xs-4 pull-left">
                    <p class="form-control-static">${student.mobile}</p>
                    <c:choose>
                     <c:when test="${isBlackList}">
                       <p class="form-control-static">已列入短信黑名单</p>
                     </c:when>
                   
                   </c:choose>
                  </div>
                  <label class="control-label col-xs-2">创建时间：</label>
                  <div class="col-xs-4 pull-left">
                    <p class="form-control-static">
                      <fmt:formatDate value="${student.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
                    </p>
                  </div>
                </div>
                
                <div class="form-group">
                  <label class="control-label col-xs-2">最新课程：</label>
                  <div class="col-xs-4 pull-left">
                    <p class="form-control-static">${student.course.name}</p>
                  </div>
                  <label class="control-label col-xs-2">国-省-市-区：</label>
                  <div class="col-xs-4 pull-left">
                    <p class="form-control-static">${student.user.profile.country}&nbsp;-&nbsp;${student.user.profile.province}&nbsp;-&nbsp;${student.user.profile.region}&nbsp;-&nbsp;${student.user.profile.district}</p>
                  </div>
                </div>
                
                <div class="form-group">
                  <label class="control-label col-xs-2">收货地址：</label>
                  <div class="col-xs-6 pull-left">
                    <p class="form-control-static">${student.user.profile.address}</p>
                  </div>
                </div>
                
                <div class="form-group">
                <label class="control-label col-xs-2">微信二维码：</label>
                  <div class="col-xs-4 pull-left">
                    <p class="form-control-static">
                     <a href="#"><span class="glyphicon glyphicon-download" aria-hidden="true"></span>&nbsp;下载</a>
                    </p>
                  </div>
                 <label class="col-xs-2 control-label">头像：</label>
                 <div class="col-xs-4 pull-left">
                   <c:choose>
                     <c:when test="${empty student.avatar}">
                       <p class="form-control-static">${student.avatar}</p>
                     </c:when>
                     <c:otherwise>
                       <img src="${qiniu.prod}/${student.avatar}-qrcode">
                     </c:otherwise>
                   </c:choose>
                 </div>
               </div>
               
              </div>
              
            </div>
          </div>
          
        </div>
      </div>

    </div>

  </div>

  <%@ include file="/WEB-INF/include/footer.jsp"%>
  <%@ include file="/WEB-INF/include/script.jsp"%>
 <d:resource root="${ctx.resource}/build" type="script" src="js/page/student/student-view.js">
    <script type="text/javascript">
      require(['page/student/student-view'], function(page) {
        page.init()
      })
    </script>
  </d:resource>
</body>

</html>